Attaining multiple dispatch in widespread object-oriented languages
نویسندگان
چکیده
Multiple dispatch allows determining the actual method to be executed, depending on the dynamic types of its arguments. Although some programming languages provide multiple dispatch, most widespread object-oriented languages lack this feature. Therefore, different implementation techniques are commonly used to obtain multiple dispatch in these languages. We evaluate the existing approaches, presenting a new one based on hybrid dynamic and static typing. A qualitative evaluation is presented, considering factors such as software maintainability and readability, code size, parameter generalization, and compile-time type checking. We also perform a quantitative assessment of runtime performance and memory consumption.
منابع مشابه
Compact Dispatch Tables for Dynamically Typed Object Oriented Languages
Dynamically typed object-oriented languages must perform dynamic binding for most message sends. Typically this is slow. A number of papers have reported on attempts to adapt C++-style selector table indexing to dynamically typed languages, but it is difficul to generate space-efficient tables. Our algorithm generates considerably smaller dispatch tables for languages with single inheritance th...
متن کاملInheritance Management and Method Dispatch in Reeexive Object-oriented Languages
A collection of algorithms and data structures are presented which represent a generalized framework for inheritance management and method dispatch in reeexive, dynamically typed, single-receiver languages with type/implementation-paired multiple inheritance. By storing a small amount of information, the algorithms can incrementally maintain the entire dispatch environment during the four funda...
متن کاملFast Algorithms for Compressed Multi-Method Dispatch Tables Generation
The eeciency of dynamic dispatch is a major impediment to the adoption of multi-methods in object-oriented languages. In this paper, we propose a simple multi-method dispatch scheme based on compressed dispatch tables. This scheme is applicable to any object-oriented language using a method precedence order that satisses a speciic monotonous property (e.g., as Cecil and Dylan), and guarantees t...
متن کاملModularly Typesafe Interface Dispatch in JPred
Multiple dispatch generalizes the receiver-oriented dynamic dispatch of traditional object-oriented (OO) languages by allowing the run-time classes of all arguments to be employed. While research over the last decade has shown how to integrate multiple dispatch with the modular static typechecking found in traditional OO languages, that work has been forced to impose unnatural restrictions or m...
متن کاملA Meta-Language for Typed Object-Oriented Languages
In [13] we defined the λ&-calculus, a simple extension of the typed λcalculus to model typed object-oriented languages. This paper is the continuation or, rather, the companion of [13] since it analyzes the practical counterpart of the theoretical issues introduced there. Indeed, to develop a formal study of type systems for object-oriented languages we define a meta-language based on λ& and we...
متن کامل